<!DOCTYPE html>

<html>
<head>
<meta charset="UTF-8">
<link href="style.css" type="text/css" rel="stylesheet">
<title>FABS—Absolute Value </title></head>
<body>
<h1>FABS—Absolute Value</h1>
<table>
<tr>
<th>Opcode</th>
<th>Instruction</th>
<th>64-Bit Mode</th>
<th>Compat/Leg Mode</th>
<th>Description</th></tr>
<tr>
<td>D9 E1</td>
<td>FABS</td>
<td>Valid</td>
<td>Valid</td>
<td>Replace ST with its absolute value.</td></tr></table>
<h2>Description</h2>
<p>Clears the sign bit of ST(0) to create the absolute value of the operand. The following table shows the results obtained when creating the absolute value of various classes of numbers.</p>
<h3>Table 3-17.  Results Obtained from FABS</h3>
<table>
<tr>
<th>ST(0) SRC</th>
<th>ST(0) DEST</th></tr>
<tr>
<td>− ∞</td>
<td>+ ∞</td></tr>
<tr>
<td>− F</td>
<td>+ F</td></tr>
<tr>
<td>− 0</td>
<td>+ 0</td></tr>
<tr>
<td>+ 0</td>
<td>+ 0</td></tr>
<tr>
<td>+ F</td>
<td>+ F</td></tr>
<tr>
<td>+ ∞</td>
<td>+ ∞</td></tr>
<tr>
<td>NaN</td>
<td>NaN</td></tr></table>
<p><strong>NOTES:</strong></p>
<p>F Means finite floating-point value.</p>
<p>This instruction’s operation is the same in non-64-bit modes and 64-bit mode.</p>
<h2>Operation</h2>
<pre>ST(0) ← |ST(0)|;</pre>
<h2>FPU Flags Affected</h2>
<table class="exception-table">
<tr>
<td>C1</td>
<td>Set to 0.</td></tr>
<tr>
<td>C0, C2, C3</td>
<td>Undefined.</td></tr></table>
<h2>Floating-Point Exceptions</h2>
<table class="exception-table">
<tr>
<td>#IS</td>
<td>Stack underflow occurred.</td></tr></table>
<h2>Protected Mode Exceptions</h2>
<table class="exception-table">
<tr>
<td>#NM</td>
<td>CR0.EM[bit 2] or CR0.TS[bit 3] = 1.</td></tr>
<tr>
<td>#UD</td>
<td>If the LOCK prefix is used.</td></tr></table>
<h2>Real-Address Mode Exceptions</h2>
<p>Same exceptions as in protected mode.</p>
<h2>Virtual-8086 Mode Exceptions</h2>
<p>Same exceptions as in protected mode.</p>
<h2>Compatibility Mode Exceptions</h2>
<p>Same exceptions as in protected mode.</p>
<h2>64-Bit Mode Exceptions</h2>
<p>Same exceptions as in protected mode.</p></body></html>